import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:razer_one/app/main/utils/view.utils.dart';

class HomeAddController extends GetxController {
  final titleTF = TextEditingController();
  final contentTF = TextEditingController();
  var currentIndex = 0;
  var dateBtnTitle = "选择时间";

  void currentIndexChanged(int index) {
    currentIndex = index;
    update();
  }

  void showDateSelect() {
    ViewUtils.showDateTimePicker(Get.context!, isSelectRange: true)
        .then((selectTime) {
      if (selectTime.isNotEmpty) {
        dateBtnTitle = selectTime;
        update();
      }
    });
  }
}
